<template>
  <div style="width: 100%; height: 800px">
    <video :src="videoUrl" style="width: 100%; height: 100%" controls></video>
  </div>
</template>

<script>
import { preview } from "@/api/file/index.js";
export default {
  props: {
    previewData: {
      typeof: Object,
      default: null,
    },
  },
  data() {
    return {
      videoUrl: "",
    };
  },
  methods: {
    getData() {
      preview({ fileId: this.previewData.fileId })
        .then((res) => {
          this.videoUrl = res.data.url;
        })
        .catch((err) => {
          console.log(err);
        });
    },
  },
  mounted() {
    this.getData();
  },
};
</script>

<style>
</style>